<?php
include("header.php");

$sql = "SELECT collegeID as id, collegeName as name FROM college ORDER BY name ASC";
$r = mysql_query($sql, $con);

$colleges = array();
if(mysql_num_rows($r)) {
	while($college = mysql_fetch_assoc($r)) {
		$colleges[] = $college;
	}
}

header('Content-type: application/json');
echo json_encode(array('colleges'=>$colleges));

include("footer.php");
?>